﻿using System;
using System.Text;

namespace GPS.GPSLanguage
{
    class SNRToken
    {
        internal static void ParseLanguage(GPSData gpsData, System.Collections.Queue q)
        {
            String snrToken = (String)q.Dequeue();
            int snrNumber = -1;
            try
            {
                if(snrToken.Length>0)
                    snrNumber = int.Parse(snrToken);
            }
            catch { }

            gpsData.SetSNR(gpsData.CurrentSatelliteCount, snrNumber);
            if (gpsData.CurrentSatelliteCount + 1 == gpsData.SatelliteCount)
            {
                gpsData.SetGPSSentenceComplete();
            }
        }
    }
}
